package com.mlearning.demo.service.impl;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mlearning.demo.mapper.TreeMapper;
import com.mlearning.demo.service.TreeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("treeService")
public class TreeServiceImpl implements TreeService {
    @Autowired
    private TreeMapper treeMapper;
    @Override
    public int delMastered(int userid,String know){
        return treeMapper.delMastered(userid,know);
    }
    @Override
    public int addMastered(int userid,String know,long timestamp){
        return treeMapper.addMastered(userid,know,timestamp);
    }
    @Override
    public int delMyKnowledge(int userid,int tree,int no){
        return treeMapper.delMyKnowledge(userid,tree,no);
    }
    @Override
    public int addMyKnowledge(int userid,String know,int tree,int no,long timestamp){
        return treeMapper.addMyKnowledge(userid,know,tree,no,timestamp);
    }
    @Override
    public int updateTreeNo(int userid,int tree){
        return treeMapper.updateTreeNo(userid, tree);
    }
    @Override
    public int updateKnowledgeNo(int userid,int tree,int no){
        return treeMapper.updateKnowledgeNo(userid, tree, no);
    }
    @Override
    public String getMyTrees(int userid){
        return treeMapper.getMyTrees(userid).toString();
    }
}
